﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="XLTJB.aspx.cs" Inherits="ZHCX_XLTJB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v12.1, Version=12.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
  Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dxwgv" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v12.1.Export, Version=12.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
  Namespace="DevExpress.Web.ASPxGridView.Export" TagPrefix="dxwgv" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v12.1, Version=12.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
  Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
  <title>线路统计表</title>
  <script src="../FCF/js/FusionCharts.js" type="text/javascript"></script>
  <script src="../jquery-easyui-1.3/jquery-1.7.2.min.js" type="text/javascript"></script>
  <style type="text/css">
    body
    {
      color: #000;
      background-color: #EEF2FB;
      margin: 0px;
      font-family: "宋体";
      font-size: 12px;
    }
  </style>
  <link href="../css/main.css" rel="stylesheet" type="text/css" />
  <script type="text/javascript">
    function loadchart(chartname, colindex) {
      //      alert(($("#ASPxGridView1_cell5_2_Label3").text());
      //      if (colindex == 0) colindex = 11;
      //      else 
      colindex = colindex - 1;
      //            alert(colindex);
      $("#chartDiv").show();
      var xml = "<graph caption='" + chartname + "'showNames='1' showValues='0' decimalPrecision='0'  formatNumberScale='0' baseFont='宋体' baseFontSize='12'>";
      xml = xml + "<categories> <category name='一月'/><category name='二月'/><category name='三月'/><category name='四月'/>" +
"<category name='五月'/><category name='六月'/><category name='七月'/><category name='八月'/><category name='九月'/>" +
"<category name='十月'/><category name='十一月'/><category name='十二月'/></categories>";
      var s1 = "<dataset seriesName='应收气量'>";
      var s2 = "<dataset seriesName='应收气费'>";
      for (var i = 2; i < 25; i++) {
        s1 = s1 + "<set value='" + ($("#ASPxGridView1_cell" + colindex + "_" + i + "_Label3").text()).replace(/,/g, "") + "'/>";
        s2 = s2 + "<set value='" + ($("#ASPxGridView1_cell" + colindex + "_" + (i + 1) + "_Label3").text()).replace(/,/g, "") + "'/>";
        i++;
      }
      s1 = s1 + "</dataset>";
      s2 = s2 + "</dataset>";
      xml = xml + s1 + s2 + "</graph>";
//      alert(s1);
      var chartObj = new FusionCharts("../FCF/MSLine.swf", "chart", "900", "300");
      chartObj.setDataXML(xml);
      chartObj.render("chartDiv");
    }
  </script>
</head>
<body>
  <form id="form1" runat="server">
  <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#EEF2FB">
    <tr>
      <td>
        <asp:Label ID="Label1" runat="server" Text="年份" Font-Size="12px"></asp:Label>
        <asp:DropDownList ID="ddlYear" runat="server">
        </asp:DropDownList>
        <%--<asp:Label ID="Label2" runat="server" Text="月份" Font-Size="12px"></asp:Label>
        <asp:DropDownList ID="ddlMonth" runat="server">
          <asp:ListItem Value="01">一月</asp:ListItem>
          <asp:ListItem Value="02">二月</asp:ListItem>
          <asp:ListItem Value="03">三月</asp:ListItem>
          <asp:ListItem Value="04">四月</asp:ListItem>
          <asp:ListItem Value="05">五月</asp:ListItem>
          <asp:ListItem Value="06">六月</asp:ListItem>
          <asp:ListItem Value="07">七月</asp:ListItem>
          <asp:ListItem Value="08">八月</asp:ListItem>
          <asp:ListItem Value="09">九月</asp:ListItem>
          <asp:ListItem Value="10">十月</asp:ListItem>
          <asp:ListItem Value="11">十一月</asp:ListItem>
          <asp:ListItem Value="12">十二月</asp:ListItem>
        </asp:DropDownList>--%>
        <asp:Button ID="btnQuery" runat="server" Text="查询" OnClick="btnQuery_Click" />
        <dxwgv:ASPxGridViewExporter ID="ASPxGridViewExporter1" runat="server" GridViewID="ASPxGridView1">
        </dxwgv:ASPxGridViewExporter>
        <asp:Button ID="Button1" runat="server" Text="导出excel" OnClick="btnExport_Click" />
      </td>
    </tr>
  </table>
  <div style="width: 98%;">
    <dxwgv:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False"
      KeyFieldName="xh" Width="100%" CssFilePath="~/App_Themes/Office2003 Blue/{0}/styles.css"
      CssPostfix="Office2003_Blue" Theme="Aqua">
      <SettingsBehavior AllowFocusedRow="True" AutoFilterRowInputDelay="-1" />
      <SettingsPager Mode="ShowPager" PageSize="10">
        <FirstPageButton Text="首页" Visible="True">
        </FirstPageButton>
        <LastPageButton Text="末页" Visible="True">
        </LastPageButton>
        <Summary Text="总页数 {1} 当前页 {0} (总记录 {2})" />
      </SettingsPager>
      <Styles CssFilePath="~/App_Themes/Office2003 Blue/{0}/styles.css" CssPostfix="Office2003_Blue">
        <Header ImageSpacing="5px" SortingImageSpacing="5px">
        </Header>
        <LoadingPanel ImageSpacing="10px">
        </LoadingPanel>
      </Styles>
      <Images ImageFolder="~/App_Themes/Office2003 Blue/{0}/">
        <FilterRowButton Height="13px" Width="13px" />
        <CollapsedButton Height="12px" Url="~/App_Themes/Office2003 Blue/GridView/gvCollapsedButton.png"
          Width="11px" />
        <ExpandedButton Height="12px" Url="~/App_Themes/Office2003 Blue/GridView/gvExpandedButton.png"
          Width="11px" />
        <DetailCollapsedButton Height="12px" Url="~/App_Themes/Office2003 Blue/GridView/gvCollapsedButton.png"
          Width="11px" />
        <DetailExpandedButton Height="12px" Url="~/App_Themes/Office2003 Blue/GridView/gvExpandedButton.png"
          Width="11px" />
      </Images>
      <Columns>
        <dxwgv:GridViewDataTextColumn Caption="序号" FieldName="xh" VisibleIndex="0" Width="50px"
          FixedStyle="Left">
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn Caption="线路" FieldName="KHXX_SFSB" VisibleIndex="1"
          Width="100px" FixedStyle="Left">
          <Settings AutoFilterCondition="Equals" />
          <DataItemTemplate>
            <a href="javascript:loadchart('<%#Eval("KHXX_SFSB").ToString() %>','<%#Convert.ToInt32(Eval("xh").ToString()) %>')">
              <%#Eval("KHXX_SFSB")%></a>
          </DataItemTemplate>
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn Caption="1月应收气量" FieldName="YSQL_1" VisibleIndex="1"
          Width="80px">
          <DataItemTemplate>
            <asp:Label ID="Label3" runat="server" Text='<%#Eval("YSQL_1").ToString()==""?"&nbsp;":string.Format("{0:n}", Convert.ToDecimal(Eval("YSQL_1"))) %>'></asp:Label>
          </DataItemTemplate>
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn Caption="1月应收气费" FieldName="YSQF_1" VisibleIndex="1"
          Width="80px">
          <DataItemTemplate>
            <asp:Label ID="Label3" runat="server" Text='<%#Eval("YSQF_1").ToString()==""?"&nbsp;":string.Format("{0:n}", Convert.ToDecimal(Eval("YSQF_1"))) %>'></asp:Label>
          </DataItemTemplate>
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn Caption="2月应收气量" FieldName="YSQL_2" VisibleIndex="1"
          Width="80px">
          <DataItemTemplate>
            <asp:Label ID="Label3" runat="server" Text='<%#Eval("YSQL_2").ToString()==""?"&nbsp;":string.Format("{0:n}", Convert.ToDecimal(Eval("ysql_2"))) %>'></asp:Label>
          </DataItemTemplate>
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn Caption="2月应收气费" FieldName="YSQF_2" VisibleIndex="1"
          Width="80px">
          <DataItemTemplate>
            <asp:Label ID="Label3" runat="server" Text='<%#Eval("YSQF_2").ToString()==""?"&nbsp;":string.Format("{0:n}", Convert.ToDecimal(Eval("YSQF_2"))) %>'></asp:Label>
          </DataItemTemplate>
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn Caption="3月应收气量" FieldName="YSQL_3" VisibleIndex="1"
          Width="80px">
          <DataItemTemplate>
            <asp:Label ID="Label3" runat="server" Text='<%#Eval("YSQL_3").ToString()==""?"&nbsp;":string.Format("{0:n}", Convert.ToDecimal(Eval("ysql_3"))) %>'></asp:Label>
          </DataItemTemplate>
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn Caption="3月应收气费" FieldName="YSQF_3" VisibleIndex="1"
          Width="80px">
          <DataItemTemplate>
            <asp:Label ID="Label3" runat="server" Text='<%#Eval("YSQF_1").ToString()==""?"&nbsp;":string.Format("{0:n}", Convert.ToDecimal(Eval("YSQF_3"))) %>'></asp:Label>
          </DataItemTemplate>
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn Caption="4月应收气量" FieldName="YSQL_4" VisibleIndex="1"
          Width="80px">
          <DataItemTemplate>
            <asp:Label ID="Label3" runat="server" Text='<%#Eval("YSQL_4").ToString()==""?"&nbsp;":string.Format("{0:n}", Convert.ToDecimal(Eval("ysql_4"))) %>'></asp:Label>
          </DataItemTemplate>
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn Caption="4月应收气费" FieldName="YSQF_4" VisibleIndex="1"
          Width="80px">
          <DataItemTemplate>
            <asp:Label ID="Label3" runat="server" Text='<%#Eval("YSQF_4").ToString()==""?"&nbsp;":string.Format("{0:n}", Convert.ToDecimal(Eval("YSQF_4"))) %>'></asp:Label>
          </DataItemTemplate>
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn Caption="5月应收气量" FieldName="YSQL_5" VisibleIndex="1"
          Width="80px">
          <DataItemTemplate>
            <asp:Label ID="Label3" runat="server" Text='<%#Eval("YSQL_5").ToString()==""?"&nbsp;":string.Format("{0:n}", Convert.ToDecimal(Eval("ysql_5"))) %>'></asp:Label>
          </DataItemTemplate>
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn Caption="5月应收气费" FieldName="YSQF_5" VisibleIndex="1"
          Width="80px">
          <DataItemTemplate>
            <asp:Label ID="Label3" runat="server" Text='<%#Eval("YSQF_5").ToString()==""?"&nbsp;":string.Format("{0:n}", Convert.ToDecimal(Eval("YSQF_5"))) %>'></asp:Label>
          </DataItemTemplate>
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn Caption="6月应收气量" FieldName="YSQL_6" VisibleIndex="1"
          Width="80px">
          <DataItemTemplate>
            <asp:Label ID="Label3" runat="server" Text='<%#Eval("YSQL_6").ToString()==""?"&nbsp;":string.Format("{0:n}", Convert.ToDecimal(Eval("ysql_6"))) %>'></asp:Label>
          </DataItemTemplate>
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn Caption="6月应收气费" FieldName="YSQF_6" VisibleIndex="1"
          Width="80px">
          <DataItemTemplate>
            <asp:Label ID="Label3" runat="server" Text='<%#Eval("YSQF_6").ToString()==""?"&nbsp;":string.Format("{0:n}", Convert.ToDecimal(Eval("YSQF_6"))) %>'></asp:Label>
          </DataItemTemplate>
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn Caption="7月应收气量" FieldName="YSQL_7" VisibleIndex="1"
          Width="80px">
          <DataItemTemplate>
            <asp:Label ID="Label3" runat="server" Text='<%#Eval("YSQL_7").ToString()==""?"&nbsp;":string.Format("{0:n}", Convert.ToDecimal(Eval("ysql_7"))) %>'></asp:Label>
          </DataItemTemplate>
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn Caption="7月应收气费" FieldName="YSQF_7" VisibleIndex="1"
          Width="80px">
          <DataItemTemplate>
            <asp:Label ID="Label3" runat="server" Text='<%#Eval("YSQF_7").ToString()==""?"&nbsp;":string.Format("{0:n}", Convert.ToDecimal(Eval("YSQF_7"))) %>'></asp:Label>
          </DataItemTemplate>
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn Caption="8月应收气量" FieldName="YSQL_8" VisibleIndex="1"
          Width="80px">
          <DataItemTemplate>
            <asp:Label ID="Label3" runat="server" Text='<%#Eval("YSQL_8").ToString()==""?"&nbsp;":string.Format("{0:n}", Convert.ToDecimal(Eval("ysql_8"))) %>'></asp:Label>
          </DataItemTemplate>
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn Caption="8月应收气费" FieldName="YSQF_8" VisibleIndex="1"
          Width="80px">
          <DataItemTemplate>
            <asp:Label ID="Label3" runat="server" Text='<%#Eval("YSQF_8").ToString()==""?"&nbsp;":string.Format("{0:n}", Convert.ToDecimal(Eval("YSQF_8"))) %>'></asp:Label>
          </DataItemTemplate>
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn Caption="9月应收气量" FieldName="YSQL_9" VisibleIndex="1"
          Width="80px">
          <DataItemTemplate>
            <asp:Label ID="Label3" runat="server" Text='<%#Eval("YSQL_9").ToString()==""?"&nbsp;":string.Format("{0:n}", Convert.ToDecimal(Eval("ysql_9"))) %>'></asp:Label>
          </DataItemTemplate>
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn Caption="9月应收气费" FieldName="YSQF_9" VisibleIndex="1"
          Width="80px">
          <DataItemTemplate>
            <asp:Label ID="Label3" runat="server" Text='<%#Eval("YSQF_9").ToString()==""?"&nbsp;":string.Format("{0:n}", Convert.ToDecimal(Eval("YSQF_9"))) %>'></asp:Label>
          </DataItemTemplate>
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn Caption="10月应收气量" FieldName="YSQL_10" VisibleIndex="1"
          Width="80px">
          <DataItemTemplate>
            <asp:Label ID="Label3" runat="server" Text='<%#Eval("YSQL_10").ToString()==""?"&nbsp;":string.Format("{0:n}", Convert.ToDecimal(Eval("ysql_10"))) %>'></asp:Label>
          </DataItemTemplate>
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn Caption="10月应收气费" FieldName="YSQF_10" VisibleIndex="1"
          Width="80px">
          <DataItemTemplate>
            <asp:Label ID="Label3" runat="server" Text='<%#Eval("YSQF_10").ToString()==""?"&nbsp;":string.Format("{0:n}", Convert.ToDecimal(Eval("YSQF_10"))) %>'></asp:Label>
          </DataItemTemplate>
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn Caption="11月应收气量" FieldName="YSQL_11" VisibleIndex="1"
          Width="80px">
          <DataItemTemplate>
            <asp:Label ID="Label3" runat="server" Text='<%#Eval("YSQL_11").ToString()==""?"&nbsp;":string.Format("{0:n}", Convert.ToDecimal(Eval("ysql_11"))) %>'></asp:Label>
          </DataItemTemplate>
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn Caption="11月应收气费" FieldName="YSQF_11" VisibleIndex="1"
          Width="80px">
          <DataItemTemplate>
            <asp:Label ID="Label3" runat="server" Text='<%#Eval("YSQF_11").ToString()==""?"&nbsp;":string.Format("{0:n}", Convert.ToDecimal(Eval("YSQF_11"))) %>'></asp:Label>
          </DataItemTemplate>
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn Caption="12月应收气量" FieldName="YSQL_12" VisibleIndex="1"
          Width="80px">
          <DataItemTemplate>
            <asp:Label ID="Label3" runat="server" Text='<%#Eval("YSQL_12").ToString()==""?"&nbsp;":string.Format("{0:n}", Convert.ToDecimal(Eval("ysql_12"))) %>'></asp:Label>
          </DataItemTemplate>
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn Caption="12月应收气费" FieldName="YSQF_12" VisibleIndex="1"
          Width="80px">
          <DataItemTemplate>
            <asp:Label ID="Label3" runat="server" Text='<%#Eval("YSQF_12").ToString()==""?"&nbsp;":string.Format("{0:n}", Convert.ToDecimal(Eval("YSQF_12"))) %>'></asp:Label>
          </DataItemTemplate>
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn Caption="合计气量" FieldName="HJQL" VisibleIndex="1" Width="80px">
          <%-- <DataItemTemplate>
                  <asp:Label ID="Label3" runat="server" Text='<%#Eval("YSQF_12").ToString()==""?"&nbsp;":string.Format("{0:n}", Convert.ToDecimal(Eval("YSQF_12"))) %>'></asp:Label>
                </DataItemTemplate>--%>
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn Caption="合计气费" FieldName="HJQF" VisibleIndex="1" Width="80px">
          <%-- <DataItemTemplate>
                  <asp:Label ID="Label3" runat="server" Text='<%#Eval("YSQF_12").ToString()==""?"&nbsp;":string.Format("{0:n}", Convert.ToDecimal(Eval("YSQF_12"))) %>'></asp:Label>
                </DataItemTemplate>--%>
        </dxwgv:GridViewDataTextColumn>
      </Columns>
      <Settings ShowHorizontalScrollBar="True" UseFixedTableLayout="True" ShowFooter="true"
        ShowFilterRowMenu="true" ShowFilterRow="true" />
      <StylesEditors>
        <ProgressBar Height="25px">
        </ProgressBar>
      </StylesEditors>
      <%-- <TotalSummary>
        <dxwgv:ASPxSummaryItem FieldName="xh" SummaryType="Count" DisplayFormat="合计" />
        <dxwgv:ASPxSummaryItem FieldName="CX_KHMC" SummaryType="Count" DisplayFormat="客户数量:{0}" />
        <dxwgv:ASPxSummaryItem FieldName="CX_YSQL" SummaryType="Sum" DisplayFormat="{0:n}" />
        <dxwgv:ASPxSummaryItem FieldName="CX_SR" SummaryType="Sum" DisplayFormat="{0:n}" />
        <dxwgv:ASPxSummaryItem FieldName="CX_JGJJ" SummaryType="Sum" DisplayFormat="{0:n}" />
        <dxwgv:ASPxSummaryItem FieldName="CX_BC" SummaryType="Sum" DisplayFormat="{0:n}" />
        <dxwgv:ASPxSummaryItem FieldName="CX_BQSJ" SummaryType="Sum" DisplayFormat="{0:n}" />
        <dxwgv:ASPxSummaryItem FieldName="CX_SSQL" SummaryType="Sum" DisplayFormat="{0:n}" />
        <dxwgv:ASPxSummaryItem FieldName="CX_SJSR" SummaryType="Sum" DisplayFormat="{0:n}" />
        <dxwgv:ASPxSummaryItem FieldName="CX_SJJGJJ" SummaryType="Sum" DisplayFormat="{0:n}" />
        <dxwgv:ASPxSummaryItem FieldName="CX_XJ" SummaryType="Sum" DisplayFormat="{0:n}" />
        <dxwgv:ASPxSummaryItem FieldName="CX_SQJY" SummaryType="Sum" DisplayFormat="{0:n}" />
        <dxwgv:ASPxSummaryItem FieldName="CX_BQJY" SummaryType="Sum" DisplayFormat="{0:n}" />
        <dxwgv:ASPxSummaryItem FieldName="CX_SLLJCY" SummaryType="Sum" DisplayFormat="{0:n}" />
        <dxwgv:ASPxSummaryItem FieldName="JELJCY" SummaryType="Sum" DisplayFormat="{0:n}" />
      </TotalSummary>--%>
    </dxwgv:ASPxGridView>
  </div>
  <div id="chartDiv" style="display: none">
    loading chart....
  </div>
  </form>
</body>
</html>
